Skip to content

Adds functionality to block vault deposits #6361

Open
Tapanito wants to merge 72 commits into
developfrom
tapanito/vault-block-deposit
Open

Adds functionality to block vault deposits #6361
Tapanito wants to merge 72 commits into
developfrom
tapanito/vault-block-deposit

Conversation

@Tapanito

Copy link
Copy Markdown
Collaborator

Specification: XRPLF/XRPL-Standards#469

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@Tapanito Tapanito changed the base branch from develop to tapanito/lending-fix-amendment February 12, 2026 16:43
@Tapanito Tapanito changed the title [W.I.P] Adds functionality to block vault deposits Adds functionality to block vault deposits Feb 17, 2026
Comment thread src/test/app/Vault_test.cpp Outdated
{
auto tx = vault.set({.owner = owner, .id = keylet.key});
tx[sfFlags] = tfVaultPrivate;
tx[sfFlags] = tfVaultDepositBlock | tfVaultDepositUnblock;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer note: tfVaultPrivate and tfVaultDepositBlock have identical numerical values.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer note: tfVaultPrivate and tfVaultDepositBlock have identical numerical values.

Is that a coincidence, or does it have functional implications?

Also, if you have a reason to want this intentionally, enforce it in the code with a static_assert. (There's an example in the "VaultCreate flags".)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a coincidence, there are no implications. The comment is to say that even though I changed the flags, the unit-test still tests the same logic: an invalid flag.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a coincidence, there are no implications. The comment is to say that even though I changed the flags, the unit-test still tests the same logic: an invalid flag.

Oh, I see. tfVaultPrivate was never a valid flag for VaultSet, but since you added tfVaultDepositBlock with the same value, it would have looked valid, so you had to change it to an invalid combo.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spot on!

@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.5%. Comparing base (68e4fbd) to head (f2495dc).
⚠️ Report is 205 commits behind head on tapanito/lending-fix-amendment.

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##           tapanito/lending-fix-amendment   #6361   +/-   ##
==============================================================
  Coverage                            81.5%   81.5%           
==============================================================
  Files                                 999     999           
  Lines                               74550   74595   +45     
  Branches                             7560    7553    -7     
==============================================================
+ Hits                                60722   60778   +56     
+ Misses                              13828   13817   -11     
Files with missing lines Coverage Δ
include/xrpl/protocol/LedgerFormats.h 100.0% <ø> (ø)
include/xrpl/protocol/TxFlags.h 100.0% <ø> (ø)
include/xrpl/tx/transactors/vault/VaultClawback.h 100.0% <ø> (ø)
include/xrpl/tx/transactors/vault/VaultDeposit.h 100.0% <ø> (ø)
include/xrpl/tx/transactors/vault/VaultSet.h 100.0% <ø> (ø)
include/xrpl/tx/transactors/vault/VaultWithdraw.h 100.0% <ø> (ø)
src/libxrpl/ledger/helpers/VaultHelpers.cpp 100.0% <100.0%> (ø)
src/libxrpl/tx/transactors/vault/VaultClawback.cpp 97.7% <100.0%> (-<0.1%) ⬇️
src/libxrpl/tx/transactors/vault/VaultCreate.cpp 96.6% <100.0%> (+0.1%) ⬆️
src/libxrpl/tx/transactors/vault/VaultDelete.cpp 91.8% <ø> (ø)
... and 3 more

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ximinez ximinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

Comment thread src/libxrpl/tx/transactors/Vault/VaultSet.cpp Outdated
Comment thread src/libxrpl/ledger/View.cpp Outdated
Move vault share/asset conversion functions (assetsToSharesDeposit,
sharesToAssetsDeposit, assetsToSharesWithdraw, sharesToAssetsWithdraw)
and isVaultInsolvent from View.h/View.cpp into a dedicated
VaultHelpers.h/VaultHelpers.cpp module. Reorder includes in Vault
transactor .cpp files to place own header first. Fix VaultSet flag
validation logic.
Tapanito added 2 commits June 8, 2026 12:12
…ck-deposit

# Conflicts:
#	src/libxrpl/ledger/helpers/VaultHelpers.cpp
#	src/libxrpl/tx/transactors/vault/VaultClawback.cpp
#	src/libxrpl/tx/transactors/vault/VaultCreate.cpp
#	src/libxrpl/tx/transactors/vault/VaultDelete.cpp
#	src/libxrpl/tx/transactors/vault/VaultDeposit.cpp
#	src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp
#	src/test/app/Vault_test.cpp
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@Tapanito Tapanito requested review from ximinez and removed request for ximinez June 8, 2026 10:40

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No concerns here


Review by ReviewBot 🤖

Review by Claude Sonnet 4.6 · Prompt: V15

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@Tapanito Tapanito added this to the Lending Protocol 1.1 milestone Jun 8, 2026
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@github-actions

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. Code looks good!

Review by Claude Sonnet 4.6 · Prompt: V15

@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@Tapanito Tapanito force-pushed the tapanito/lending-fix-amendment branch from eaf80ce to 60700c5 Compare June 26, 2026 12:48
Base automatically changed from tapanito/lending-fix-amendment to develop July 1, 2026 00:25
@Tapanito Tapanito removed the request for review from ximinez July 1, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants